1.6 Using the keyboard

The Android and desktop versions of Myron use the same expression language. However, the way in which expressions are entered differs between the two. While the desktop version makes use of a conventional hardware keyboard, the Android version uses a purpose-built software keyboard. And, while keyboards may seem a straightforward technology, there are quirks, both mathematical and Android-related, that require explanation.

1.6.1 Android Keyboard

The soft keyboard is displayed when the text- input area is touched. The keyboard contains keys for conventional numeric and operator symbols, but there are also a number of keys for special symbols, like π , Ai and Xy .

The soft keyboard also has two shift keys: and . Touching either of the shift keys changes the symbols displayed on the keyboard, giving two more keyboard configurations. Engaging both shift keys causes both of them to be activated, giving a fourth keyboard configuration. See Figure §1.4.

Myron supports a large number of operators and it is not possible to display all of them at the same time. Rather, 10 of the keys with operator symbols provide a gateway to popup keyboards – displayed when one of these keys is touched – with additional operator symbols. (In previous versions of Myron, all of the operator symbols appeared on one of the four keyboards. However, the memory burden proved onerous. In addition, the number of operators has increased beyond the capacity of the four keyboards. The popup gateway was introduced in build 1466.) See Figure 1.5 and §1.6.1.1. The alternate keyboards are still supported, but they have been simplified to provide access to only Greek letters and various transcendental functions.

7 8 9 + (
4 5 6
1 2 3 ʈ =
0 . , A i X y
u v w x y z

(a) Unshifted
sin tan sec + (
cos cot csc
ln log root ʈ =
if . , A i X y
U V W X Y Z

(b) Shifted with ⇓
sin tan sec + (
cos cot csc
ln log root ʈ =
re im arg A i X y
υ φ χ ψ ω

(c) Shifted with ⇑
acsc atan asec + (
acos acot asin
ln log root ʈ =
if . , A i X y
Υ Φ Χ Ψ Ω

(d) Shifted with ⇑ and ⇓
Figure 1.4 Android Keyboards

Unlike a computer keyboard where two keys can be pressed simultaneously, the shift keys in Android are sticky; they stay activated until another key is pressed. This means that if the shift-up key is touched and then the x key is touched twice, the first x will be uppercase (shifted) and the second will be lowercase because of auto-deactivation. The effect of shift lock is obtained if a shift key is touched and held (long touch). The shift key will remain activated until touched again.

While the shift-up key switches between lower- and upper-case characters, the shift-down key switches between English and Greek character sets. In Greek mode, the shift-up key switches between lower- and upper-case Greek characters. Similar to the shift keys, the alphabet-selection keys ◀ and ▶ present sections of the alphabet.

Myron initially chooses a soft-keyboard layout consistent with the size and density of the device screen. The choice can be altered by cycling through the available keyboard layouts by touching while the keyboard is displayed. The keyboard layout can also be changed using Settings .

1.6.1.1 Popup Keyboards

The operators on the soft keyboard produce popup keyboards with additional operators. In a sense, the soft-keyboard operators are merely classification hints to the contents of the popup keyboards. In Figure 1.5, the operator in the Gateway column triggers a popup keyboard containing symbols in the Operator column.

Classification Gateway Operators
algebraic + + - ⋅ ÷ / ¦ ^ √ × ⊗ ± ∓ ° !
boolean ⊕ ∧ ∨ ¬ ⇒ ⊤ ⊥
collection ʈ ʈ ɱ ʂ ⅈ ⅉ ʋ ɽ ɓ ∠ # Ø ɪ ∈ ↓ ↑ ‖ @
enclosure ( ( ) { } [ ] ‹ › « » ⌈ ⌉ ⌊ ⌋ |
function → ← λ ’ _ ? : ;
integral ∫ ⅆ ∂ ∇ ∑ ∏
quantifier ∃ ∄ ∀ ⇒
relative = = ≠ < ≤ > ≥ ∈ ∉ ≈ ≡
set ∈ ∉ ∪ ∩ \ ⊂ ⊆ ⊄ ⊈ △
symbol ℼ ⅇ ℮ ℽ ĉ ∞ ℂ ℕ ℙ ℚ ℝ 𝕏 𝕐 ℤ
Figure 1.5 Android Popup Keyboards

1.6.1.2 Popup Cache

Popup keyboards address the problem of having a large number of operator symbols. Even with popups, entering expressions can be tedious. However, based on the observation that expressions are confined to the mathematical task at hand, the number of operators actually used at any given time is quite small. Extended keyboards are provided with extra keys that cache recently used symbols. Initially, the extra keys are empty. As operators are selected from popup keyboards, they are placed on the extra keys. Management of the key cache uses a technique from the operating-system concept of demand paging. When the cache is full, entries are selected for replacement using a least-recently-used algorithm. Thus the cache contains recently-used operators; frequently used operators remain in the cache; and operators retain their position in the cache until usurped.

1.6.2 Desktop keyboard

In the desktop version of Myron, expressions are entered using the regular keyboard. Similar to the Android popup keyboards, a keyboard aide is available to enter special symbols.

1.6.2.1 Direct entry

Click in the text-input area to set the focus and type as usual. The usual keyboard editing controls are available: Ctrl-a, Ctrl-x, Ctrl-c and Ctrl-v. Special symbols are entered using $-escapes and Greek letters are entered using tick-escapes. (See §2.11 for a complete list of $- and tick-escapes.)

1.6.2.2 Keyboard aide

The button near the text-input area (Figure 1.2) displays a window containing all of the operator symbols arranged by classification hint. Clicking on a classification hint displays a different set of symbol buttons. Clicking on any of the buttons inserts the symbol into the text-input area. If the symbol corresponds to a $-escaped symbol, the $-escape is inserted instead, as a sort of learning aid. The button panel is shown in Figure 1.6.

Figure 1.6 Desktop Operator Symbols